﻿using System;

namespace ClientEndpoint
{
	public class WrongNodeNameException : Exception
	{
		private readonly Package.NameErrorPackage package_;
		public WrongNodeNameException(Package.NameErrorPackage package)
		{
			package_ = package;
		}
		public override string ToString()
		{
			return "Sent message with name =" + package_.data + ".\nProgram will exit now.";
		}
	}
	public class WrongCodeException : Exception
	{
		private readonly Package.InvalidMessagePackage package_;
		public WrongCodeException(Package.InvalidMessagePackage package)
		{
			package_ = package;
		}
		public override string ToString()
		{
			return "Sent message with code =" + (int)package_.data + ".\nProgram will exit now.";
		}
	}
}
